<%@page import="com.cn.dao.DepartmentDao"%>
<%@page import="com.cn.entity.Department"%>
<%@page import="com.cn.entity.TiJianxiangmu"%>
<%@page import="com.cn.dao.TiJianXiangmuDao"%>

<%@page import="java.util.List"%>

<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>北京医院</title>
</head>
<body>
<form action="XiangmuAddAction" method="post">
<table>
<tr>
<td>项目名</td>
<td><input type="text" name="xiangmu.xiangmuming"></td>
</tr>

<tr>   <td>所属科室</td> 
<td><select name="departmentname">
<%DepartmentDao ded=new DepartmentDao();
 List<Department>  list1=ded.scanAll();
%>
<%for (int i=0;i<list1.size();i++){
Department department=list1.get(i);	%>
<option><%=department.getDepartmentname() %></option>
<%} %>
</select>
</td>
</tr>
<tr>

<td>价格</td>
<td><input type="text" name="xiangmu.price"></td>

</tr>
<tr>

<td></td>
<td><input type="submit" value="增加"></td>

</tr>
</table>
</form>
<br>
<br>
<% TiJianXiangmuDao dd=new TiJianXiangmuDao(); 
List<TiJianxiangmu> list=dd.scanAll();
%>
<table>
<tr>
<td>项目名</td>
<td>所属科室</td>
<td>价格</td>


</tr>
<%for (int i=0;i<list.size();i++) { 
TiJianxiangmu xiangmu=list.get(i);
%>
<tr> 
<td><%=xiangmu.getXiangmuming() %></td>
<td><%Department department=xiangmu.getDepartment(); %>
<%=department.getDepartmentname() %>
</td>
<td><%=xiangmu.getPrice() %></td>


<td><a href="XiangmuDeleteAction?xiangmuid=<%=xiangmu.getXiangmuid()%>">删除</a>|<a href="xiangmuupdate.jsp?xiangmuid=<%=xiangmu.getXiangmuid()%>">修改</a>

</td>

  </tr>

<%} %>
</table>
</body>
</html>